home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-06 | 1.0 KB | 48 lines | [TEXT/QED1] |
- /*
- Terminal 1.7
- "Log into Beach Box.s"
- */
-
- check(char *command, char *reply) /* Send command and wait for reply */
- {
- type(command);
- return prompt(reply, 1800); /* Timeout = 30 sec */
- }
-
- answer(char *hint, char *command) /* Wait for prompt and send command */
- {
- int result;
-
- if (result = prompt(hint, 1800))
- return result; /* Timeout or cancel */
- pause(30); /* Don't type immediatly */
- type(command);
- return 0;
- }
-
- main()
- {
- int go = 1;
-
- while (go) {
- if (check("ATDP398144\r", "CONNECT")) /* Dial */
- break;
- if (answer("Press RETURN...", "\r")) /* Wait for "Press RETURN..." */
- break;
- if (answer("<N>onstop else next..", "N"))
- break;
- if (answer("enter '0'>>", "23\r")) /* Enter account number */
- break;
- if (answer("PassWord?", "...\r")) /* Enter password */
- break;
- go = 0; /* Ok */
- }
- if (go) { /* Timeout or cancel */
- setdtr(0); /* Negate DTR: modem hangs up */
- pause(60); /* Wait one second */
- setdtr(1); /* Assert DTR: now back in command mode */
- beep(); /* 2 beeps if error */
- }
- beep();
- }
-